#include "SplitTool.h"

SplitToolCppJieba::SplitToolCppJieba(Configuration *conf)
    : _conf(conf) {};

vector<string> SplitToolCppJieba::cut(const string &sentences) {
    // 构建jieba工具
    string dic_path = _conf->get("jieba", "jieba_dict_path");
    string model_path = _conf->get("jieba", "jieba_model_path");
    string user_dic_path = _conf->get("jieba", "jieba_user_dic_path");
    string idf_path = _conf->get("jieba", "jieba_idf_path");
    string stop_word_path = _conf->get("jieba", "jieba_stop_word_path");

    cppjieba::Jieba jieba(dic_path, model_path, user_dic_path, idf_path, stop_word_path);

    vector<string> words;
    jieba.Cut(sentences, words);
    return words;
};